import cn.hutool.http.ContentType;
import cn.hutool.http.HttpRequest;

import java.util.HashMap;

/**
 * @author liuchaoqun
 * @date 2022/9/6
 * @Description
 */
public class HTTPUtils {
    public static void main(String[] args) {

        String OCR_HTTP_PATH = "http://47.96.66.157:9000/ocr/path";
        String photoUrl = "http://8.129.120.0:9000/xzimage/20220829/1661745317661_01_20220822091317169_INTRUSION_DETECTION.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xz_minio%2F20220906%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220906T013011Z&X-Amz-Expires=432000&X-Amz-SignedHeaders=host&X-Amz-Signature=0aba685163828318407b4de152d36d1a7db331996a94ab326d822792b469b22c";
        String body = HttpRequest.post(OCR_HTTP_PATH)
                .body(photoUrl, ContentType.TEXT_PLAIN.getValue())
                .timeout(6 * 1000)
                .execute().body();
        System.out.println(body);

    }
}
